<?php 
namespace app\admin\validate;
use think\Validate;
/**
 * 
 */
class Admin extends Validate{
	protected $rule = [
		['verify','require|verify','验证码必须填写|验证码错误'],
		['uname','require','姓名必须传递'],
		['pwd','require','密码必须传递'],
		['name','require','角色名或姓名必须填写'],
		['phone','require|length:11','手机号必须传递|手机号格式有误'],
		['rid','require','角色名必须填写'],
	];

	protected $scene=[
		'add'=>['pwd'],
		'login'=>['uname','pwd','verify'],
		'admin'=>['name','pwd','uname','rid','phone']
	];
	protected function verify($value){
		return captcha_check($value);
	}

}